﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Clien_Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        
    }

    protected void Button1_Click(object sender, EventArgs e)
    {
        Service.Service s = new Service.Service();
        string ten = s.LoginStudent(TextBox1.Text, TextBox2.Text);
        if (ten == TextBox1.Text)
        {
            Session["Student"] = ten;

            Response.Redirect("ListSubject.aspx?Student=" + ten);
        }
        else
        {
            Label1.Text = "ban hay dang nhap lai";
        }
    }
    protected void LinkButton1_Click(object sender, EventArgs e)
    {
        if (Session["Student"] == null)
        {
            Response.Redirect("LoginStudent.aspx");
        }
        else
        {
            Response.Redirect("ListSubject.aspx");
        }

    }
}